package com.spring.core.io.support;

/**
 * Copyright (c) 2018-2023 ThunderSoft
 * All Rights Reserved by Thunder Software Technology Co., Ltd and its affiliates.
 * You may not use, copy, distribute, modify, transmit in any form this file
 * except in compliance with ThunderSoft in writing by applicable law.
 */

import com.spring.core.io.InputStreamSource;
import com.spring.core.io.Resource;

import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.Charset;

/**
 * @author liyuncong
 * @version 1.0
 * @file EncodedResource
 * @brief EncodedResource
 * @details EncodedResource
 * @date 2023-01-13
 *
 * Edit History
 * ----------------------------------------------------------------------------
 * DATE                        NAME               DESCRIPTION
 * 2023-01-13                  liyuncong          Created
 */
public class EncodedResource implements InputStreamSource {

    private final Resource resource;

    private final String encoding;

    private final Charset charset;

    public EncodedResource(Resource resource) {
        this(resource, null, null);
    }

    public EncodedResource(Resource resource, String encoding) {
        this(resource, encoding, null);
    }

    public EncodedResource(Resource resource, Charset charset) {
        this(resource, null, charset);
    }

    public EncodedResource(Resource resource, String encoding, Charset charset) {
        super();
        this.resource = resource;
        this.encoding = encoding;
        this.charset = charset;
    }

    public Resource getResource() {
        return resource;
    }

    public String getEncoding() {
        return encoding;
    }

    public Charset getCharset() {
        return charset;
    }

    @Override
    public InputStream getInputStream() throws IOException {
        return null;
    }
}
